import request from "@/network/request";

export function getSubmissionList(userId, problemId, contestId, status, language, currentPage) {
    return request({
        url: '/submission/getList',
        params: {
            contestId,
            language,
            page: currentPage,
            problemId,
            status,
            userId
        }
    });
}

export function getSubmissionById(runId) {
    return request({
        url: '/submission/getById',
        params: {
            runId
        }
    });
}

export function uploadSubmission(language, problemId, contestId, code) {
    return request({
        url: '/submission/upload',
        data: {
            problemId,
            sourcecode: code,
            contestId,
            language
        }
    });
}

export function reJudge(contestId, userId, problemId, submissionId) {
    return request({
        url: "/submission/rejudge",
        params: {
            contestId: contestId,
            userId: userId,
            problemId: problemId,
            submissionId: submissionId
        }
    })
}
